package com.yinhe.music.yhmusic.video;

import com.yinhe.music.yhmusic.base.IBaseModel;
import com.yinhe.music.yhmusic.constants.IConstants;
import com.yinhe.music.yhmusic.http.StatusCode;
import com.yinhe.music.yhmusic.network.response.ResponseTransformer;
import com.yinhe.music.yhmusic.share.SharePresenter;

import io.reactivex.disposables.Disposable;

/**
 * {@link VideoActivity} P层
 *
 * @author 何晓华
 */
public class VideoPresenter extends SharePresenter<IBaseModel, IVideoContract.IVideoView>
        implements IVideoContract.IVideoPresenter {
    @Override
    public void getMovieTag() {

        if (getView() == null) {
            return;
        }

        Disposable collectDisposable = mModel.getTags(IConstants.MOVIE)
                .compose(ResponseTransformer.handleResult())
                .compose(schedulerProvider.applySchedulers())
                .subscribe(songMenuList -> getView().setTagUI(songMenuList)
                , throwable -> getView().showMessage(throwable));

        mDisposable.add(collectDisposable);
    }
}
